import request from '@/utils/request'
// import { checkResult } from '@/utils/utils'
// import store from '../store'
/**
 * 登录
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function login(data: any) {
  return request({
    url: 'scrm-api/console/account/login',
    method: 'post',
    data: data
  })
}
// /**
//  * 二维码扫码登录
//  * @param params
//  * @returns {PromiseLike<T | never> | Promise<T | never> | *}
//  */
// export function loginqr(data: any) {
//   return request({
//     url: 'weiwork/oath/qr',
//     method: 'get',
//     params: data
//   })
// }
//获取登录二维码
export function qrcodeLink(data: any) {
  return request({
    url: 'weiwork/oauth/qrcode-link',
    method: 'post',
    data: data
  })
}
// /**
//  * 二维码扫码登录
//  * @param params
//  * @returns {PromiseLike<T | never> | Promise<T | never> | *}
//  */
// export function wxAuthCodeLogin(data: any) {
//   return request({
//     url: 'weiwork/oath/login',
//     method: 'get',
//     params: data
//   })
// }
//授权码登录
export function getauthCode(data: any) {
  return request({
    url: 'weiwork/oauth/qrcode-login',
    method: 'get',
    params: data
  })
}

export function verificationCodeLogin(data: any) {
  return request({
    url: 'scrm-api/console/sms/login',
    method: 'POST',
    data: data
  })
}
// 短信
export function noteCode(data: any) {
  return request({
    url: 'scrm-api/console/register/send-sms-code',
    method: 'post',
    type: 0,
    data: data
  })
}
// 注册
export function registration(data: any) {
  return request({
    url: 'scrm-api/console/register',
    method: 'post',
    data: data
  })
}
// 用户
export function getUserInfo(data: any) {
  return request({
    url: 'scrm-api/console/login-api/account-info',
    method: 'get',
    params: data
  })
}
// 选择企业
export function chooseFirm(data: any) {
  return request({
    url: 'scrm-api/console/login-api/login/select-login-account',
    method: 'post',
    data: data,
  })
}
// 重置密码短信
export function resetPasswordNote() {
  return request({
    url: 'scrm-api/console/login-api/send/reset-password/sms-code',
    method: 'post'
  })
}
export function resetPassword(data: any) {
  return request({
    url: 'scrm-api/console/login-api/reset/password',
    method: 'post',
    data: data
  })
}
// 退出登录
export function logOff() {
  return request({
    url: 'scrm-api/console/login-api/logout'
  })
}
/**
 * 获取图形验证码
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
// export function fetchCode() {
//   return request({
//     url: 'scrm-api/console/register/send-sms-code',
//     method: 'get',
//   }).then((res) => checkResult(res))
// }
